wayland: Drop unused argument from query_state
authorMatthias Clasen <mclasen@redhat.com>
Wed, 26 Aug 2020 20:33:49 +0000 (16:33 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 26 Aug 2020 21:56:41 +0000 (17:56 -0400)
Now that this is backend-only api, we can just
drop unused arguments.

gdk/wayland/gdkdevice-wayland-private.h
gdk/wayland/gdkdevice-wayland.c
gdk/wayland/gdksurface-wayland.c

index a1942fbe380d415f8104affb7cb24704db152500..3dae42208142f60f46c273a55948da323c9a1335 100644 (file)
@@ -6,7 +6,6 @@
 void
 gdk_wayland_device_query_state (GdkDevice        *device,
                                 GdkSurface       *surface,
-                                GdkSurface      **child_surface,
                                 double           *win_x,
                                 double           *win_y,
                                 GdkModifierType  *mask);
index f55a593ba485daabd8ee2950f4bc15934f79a7d4..fbbceacb65a0666355db58827d93fc7c65904cfb 100644 (file)
@@ -521,29 +521,32 @@ device_get_modifiers (GdkDevice *device)
 void
 gdk_wayland_device_query_state (GdkDevice        *device,
                                 GdkSurface       *surface,
-                                GdkSurface      **child_surface,
                                 double           *win_x,
                                 double           *win_y,
                                 GdkModifierType  *mask)
 {
   GdkWaylandPointerData *pointer;
-  GList *children = NULL;
+  double x, y;
 
-  if (surface == NULL)
-    children = gdk_wayland_display_get_toplevel_surfaces (gdk_device_get_display (device));
+  if (mask)
+    *mask = device_get_modifiers (device);
 
   pointer = GDK_WAYLAND_DEVICE (device)->pointer;
 
-  if (child_surface)
-    /* Set child only if actually a child of the given surface, as XIQueryPointer() does */
-    *child_surface = g_list_find (children, pointer->focus) ? pointer->focus : NULL;
-  if (mask)
-    *mask = device_get_modifiers (device);
+  if (pointer->focus == surface)
+    {
+      x = pointer->surface_x;
+      y = pointer->surface_y;
+    }
+  else
+    {
+      x = y = -1;
+    }
 
   if (win_x)
-    *win_x = pointer->surface_x;
+    *win_x = x;
   if (win_y)
-    *win_y = pointer->surface_y;
+    *win_y = y;
 }
 
 static void
index 45769984ea76a4290ef44cd652358509a1e0181b..0fc030f9b40abbbbb5cab9b87e7c167c8f748f89 100644 (file)
@@ -3173,7 +3173,7 @@ gdk_wayland_surface_get_device_state (GdkSurface       *surface,
   if (GDK_SURFACE_DESTROYED (surface))
     return FALSE;
 
-  gdk_wayland_device_query_state (device, surface, NULL, x, y, mask);
+  gdk_wayland_device_query_state (device, surface, x, y, mask);
 
   return *x >= 0 && *y >= 0 && *x < surface->width && *y < surface->height;
 }